1. Data preprocessing: put all timepoints and replicates into one folder
  1. Read FlowJo files into R.
  2. Create a data frame with intensity measurements for each marker for all samples within the experiment to be analyzed.
  1. Harmonize data
  2. Create dataframe
  3. Create a Seurat object
  1. Cluster data
  2. Annotate clusters with cell types.
  1. Predict cell types by correlation matrix
  2. Visualize expression by cluster for manual annotation
  3. Add annotations to Seurat object
  4. Train RandomForest classifier.
  1. Reprocess with all cell in samples
  1. preprocess
  2. cluster
  3. annotate (now seurat label transfer and random forest can be used.)
  1. Compare cell type proportions and expression levels across the time course.
# load necessary libraries 
library(Seurat)
library(dplyr) 
library(ggplot2)
library(CelltypeR)

Preprocessing

Read in the flow data This data should be the gated live cells.
All samples need to be in one folder. Here we have

sampleNames(flowset)
 [1] "MBO_154d_AIW_n1_Live_Live.fcs"            
 [2] "MBO_154d_AIW_n2_Live_Live.fcs"            
 [3] "MBO_154d_AIW_n3_Live_Live.fcs"            
 [4] "MBO_154d_AIW_n4_Live_Live.fcs"            
 [5] "MBO_30d_AIW_n1_Single Cells_Live_Live.fcs"
 [6] "MBO_30d_AIW_n2_Single Cells_Live_Live.fcs"
 [7] "MBO_30d_AIW_n3_Single Cells_Live_Live.fcs"
 [8] "MBO_30d_AIW_n4_Single Cells_Live_Live.fcs"
 [9] "MBO_60d_AIW_n1_Live_Live.fcs"             
[10] "MBO_60d_AIW_n2_Live_Live.fcs"             
[11] "MBO_60d_AIW_n3_Live_Live.fcs"             
[12] "MBO_60d_AIW_n4_Live_Live.fcs"             
[13] "MBO_97d_AIW_n1_Live_Live.fcs"             
[14] "MBO_97d_AIW_n2_Live_Live.fcs"             
[15] "MBO_97d_AIW_n3_Live_Live.fcs"             
[16] "MBO_97d_AIW_n4_Live_Live.fcs"             

Rename samples with shorter names

sampleNames(flowset) <- sampleNames(flowset) <- c("AIW_150_R1","AIW_150_R2","AIW_150_R3","AIW_150_R4",
  "AIW_30_R1","AIW_30_R2","AIW_30_R3","AIW_30_R4",
  "AIW_60_R1","AIW_60_R2","AIW_60_R3","AIW_60_R4",
  "AIW_100_R1","AIW_100_R2","AIW_100_R3","AIW_100_R4"
                                                  )
sampleNames(flowset)
 [1] "AIW_150_R1" "AIW_150_R2" "AIW_150_R3" "AIW_150_R4"
 [5] "AIW_30_R1"  "AIW_30_R2"  "AIW_30_R3"  "AIW_30_R4" 
 [9] "AIW_60_R1"  "AIW_60_R2"  "AIW_60_R3"  "AIW_60_R4" 
[13] "AIW_100_R1" "AIW_100_R2" "AIW_100_R3" "AIW_100_R4"

Harmonize data to remove batch or technical variation

This requires us to look and see where there are two peaks to align. We need to visualize the peaks of the transformed data before aligning.

colnames(df)
 [1] "FSC"      "FSC"      "FSC"      "SSC"      "SSC"     
 [6] "SSC"      "CD56"     "CD56"     "CD56"     "SSEA4"   
[11] "SSEA4"    "SSEA4"    "CD140a"   "CD140a"   "CD140a"  
[16] "CD29"     "CD29"     "CD29"     "CD44"     "CD44"    
[21] "CD44"     "LiveDead" "LiveDead" "LiveDead" "CD184"   
[26] "CD184"    "CD184"    "CD24"     "CD24"     "CD24"    
[31] "CD15"     "CD15"     "CD15"     "TH"       "TH"      
[36] "TH"       "CD49f"    "CD49f"    "CD49f"    "CD133"   
[41] "CD133"    "CD133"    "Time"     "Sample"   "cell"    

Now we have made all the different processing of the fsc files. We can visualize the intensity in cell density plots to see the alignment

#plotdensity_flowset(flowset)

plotdensity_flowset(flowset_biexp)
Warning in melt(lapply(as.list(flowset@frames), function(x) { :
  The melt generic in data.table has been passed a list and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(lapply(as.list(flowset@frames), function(x) {    x = as.data.frame(x@exprs)})). In the next version, this warning will become an error.
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
Warning in geom_density_ridges(alpha = 0.4, verbose = FALSE) :
  Ignoring unknown parameters: `verbose`
Picking joint bandwidth of 0.106
Picking joint bandwidth of 0.0931
Picking joint bandwidth of 0.0233
Picking joint bandwidth of 0.124
Picking joint bandwidth of 0.107
Picking joint bandwidth of 0.023
Picking joint bandwidth of 0.224
Picking joint bandwidth of 0.202
Picking joint bandwidth of 0.396
Picking joint bandwidth of 0.236
Picking joint bandwidth of 0.166
Picking joint bandwidth of 0.199
Picking joint bandwidth of 0.25
Picking joint bandwidth of 0.232
Picking joint bandwidth of 0.374
Picking joint bandwidth of 0.227
Picking joint bandwidth of 0.212
Picking joint bandwidth of 0.352
Picking joint bandwidth of 0.281
Picking joint bandwidth of 0.24
Picking joint bandwidth of 0.325
Picking joint bandwidth of 0.213
Picking joint bandwidth of 0.152
Picking joint bandwidth of 0.172
Picking joint bandwidth of 0.351
Picking joint bandwidth of 0.265
Picking joint bandwidth of 0.407
Picking joint bandwidth of 0.246
Picking joint bandwidth of 0.236
Picking joint bandwidth of 0.195
Picking joint bandwidth of 0.234
Picking joint bandwidth of 0.222
Picking joint bandwidth of 0.394
Picking joint bandwidth of 0.309
Picking joint bandwidth of 0.281
Picking joint bandwidth of 0.398
Picking joint bandwidth of 0.343
Picking joint bandwidth of 0.275
Picking joint bandwidth of 0.337
Picking joint bandwidth of 0.236
Picking joint bandwidth of 0.205
Picking joint bandwidth of 0.34
Picking joint bandwidth of 0.14

plotdensity_flowset(flowset_align)
Warning in melt(lapply(as.list(flowset@frames), function(x) { :
  The melt generic in data.table has been passed a list and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(lapply(as.list(flowset@frames), function(x) {    x = as.data.frame(x@exprs)})). In the next version, this warning will become an error.
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
No id variables; using all as measure variables
Warning in geom_density_ridges(alpha = 0.4, verbose = FALSE) :
  Ignoring unknown parameters: `verbose`
Picking joint bandwidth of 0.105
Picking joint bandwidth of 0.0921
Picking joint bandwidth of 0.0231
Picking joint bandwidth of 0.123
Picking joint bandwidth of 0.106
Picking joint bandwidth of 0.023
Picking joint bandwidth of 0.224
Picking joint bandwidth of 0.202
Picking joint bandwidth of 0.395
Picking joint bandwidth of 0.232
Picking joint bandwidth of 0.164
Picking joint bandwidth of 0.201
Picking joint bandwidth of 0.251
Picking joint bandwidth of 0.232
Picking joint bandwidth of 0.372
Picking joint bandwidth of 0.226
Picking joint bandwidth of 0.208
Picking joint bandwidth of 0.35
Picking joint bandwidth of 0.269
Picking joint bandwidth of 0.238
Picking joint bandwidth of 0.325
Picking joint bandwidth of 0.213
Picking joint bandwidth of 0.152
Picking joint bandwidth of 0.172
Picking joint bandwidth of 0.351
Picking joint bandwidth of 0.266
Picking joint bandwidth of 0.409
Picking joint bandwidth of 0.247
Picking joint bandwidth of 0.238
Picking joint bandwidth of 0.196
Picking joint bandwidth of 0.235
Picking joint bandwidth of 0.223
Picking joint bandwidth of 0.393
Picking joint bandwidth of 0.303
Picking joint bandwidth of 0.281
Picking joint bandwidth of 0.399
Picking joint bandwidth of 0.338
Picking joint bandwidth of 0.272
Picking joint bandwidth of 0.336
Picking joint bandwidth of 0.232
Picking joint bandwidth of 0.202
Picking joint bandwidth of 0.337
Picking joint bandwidth of 0.14

#plotdensity_flowset(flowset_retro)
AB <- c("TH","CD24","CD56","CD29","CD15","CD184","CD133","SSEA4","CD44","CD49f","CD140a")

df_select <- df %>% select(c("TH","CD24","CD56","CD29","CD15","CD184","CD133","SSEA4","CD44","CD49f","CD140a","Sample"))

seu <- make_seu(df_select, AB_vector = AB)
Centering and scaling data matrix

  |                                                                          
  |                                                                    |   0%
  |                                                                          
  |====================================================================| 100%
Warning in irlba(A = t(x = object), nv = npcs, ...) :
  You're computing too large a percentage of total singular values, use a standard svd instead.
Warning: Requested number is larger than the number of available items (11). Setting to 11.
Warning: Requested number is larger than the number of available items (11). Setting to 11.
Warning: Requested number is larger than the number of available items (11). Setting to 11.
Warning: Requested number is larger than the number of available items (11). Setting to 11.
Warning: Requested number is larger than the number of available items (11). Setting to 11.
PC_ 1 
Positive:  CD24, CD15, CD29, CD140a, CD56, CD133 
Negative:  TH, SSEA4, CD49f, CD44, CD184 
PC_ 2 
Positive:  CD15, CD24, CD140a, CD56, TH, SSEA4 
Negative:  CD44, CD133, CD29, CD49f, CD184 
PC_ 3 
Positive:  CD44, CD15, CD24, CD140a, CD29, CD56 
Negative:  CD184, CD49f, CD133, TH, SSEA4 
PC_ 4 
Positive:  CD184, CD44, CD15, CD24, TH, CD56 
Negative:  CD29, CD133, SSEA4, CD140a, CD49f 
PC_ 5 
Positive:  CD56, CD49f, TH, CD133, CD24, CD15 
Negative:  SSEA4, CD184, CD140a, CD29, CD44 

You can save the data frame and seurat object for later



# to save the df for later
write.csv(df, paste(output_path,"df2000Timecourse4.csv", sep = ""))

# save the seurat object
saveRDS(seu, paste(output_path, "seuratObjectTimecourseAIW_4.RDS", sep = ""))

Check out the data object


RidgePlot(seu, features = AB, log = TRUE)
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Scale for x is already present.
Adding another scale for x, which will replace the existing scale.
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Picking joint bandwidth of 0.0762
Warning: Removed 709 rows containing non-finite values (`stat_density_ridges()`).
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Picking joint bandwidth of 0.061
Warning: Removed 311 rows containing non-finite values (`stat_density_ridges()`).
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Picking joint bandwidth of 0.0553
Warning: Removed 235 rows containing non-finite values (`stat_density_ridges()`).
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Picking joint bandwidth of 0.0564
Warning: Removed 230 rows containing non-finite values (`stat_density_ridges()`).
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Picking joint bandwidth of 0.0572
Warning: Removed 488 rows containing non-finite values (`stat_density_ridges()`).
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Picking joint bandwidth of 0.0872
Warning: Removed 1453 rows containing non-finite values (`stat_density_ridges()`).
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Picking joint bandwidth of 0.0602
Warning: Removed 311 rows containing non-finite values (`stat_density_ridges()`).
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Picking joint bandwidth of 0.0597
Warning: Removed 2300 rows containing non-finite values (`stat_density_ridges()`).
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Picking joint bandwidth of 0.0621
Warning: Removed 713 rows containing non-finite values (`stat_density_ridges()`).
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Picking joint bandwidth of 0.0817
Warning: Removed 1088 rows containing non-finite values (`stat_density_ridges()`).
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Picking joint bandwidth of 0.06
Warning: Removed 718 rows containing non-finite values (`stat_density_ridges()`).

DimPlot(seu, group.by = "Sample")

Cluster

# note the dimensions (number of PC to include needs to be one less than the number in the antibody panel)
explore_param(input = seu, 
                          cluster_method = "louvain", 
                          df_input = df.input, 
                          flow_k = NULL, 
                          pheno_lou_kn = c(80,120,200), 
                          lou_resolution = c(0.6), 
                          pcdim = 1:10,
                          run.plot = TRUE, 
                          run.stats = FALSE, 
                          save_to = NULL)
Computing nearest neighbor graph
Computing SNN
13:40:53 UMAP embedding parameters a = 0.9922 b = 1.112
13:40:53 Read 32000 rows and found 10 numeric columns
13:40:53 Using Annoy for neighbor search, n_neighbors = 80
13:40:53 Building Annoy index with metric = cosine, n_trees = 50
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
13:40:57 Writing NN index file to temp file /var/folders/k4/khtkczkd5tn732ftjpwgtr240000gn/T//RtmpcsjJYG/file2f9173d2fe46
13:40:57 Searching Annoy index using 1 thread, search_k = 8000
13:41:33 Annoy recall = 100%
13:41:34 Commencing smooth kNN distance calibration using 1 thread with target n_neighbors = 80
13:41:39 Initializing from normalized Laplacian + noise (using irlba)
13:41:41 Commencing optimization for 200 epochs, with 3116580 positive edges
Using method 'umap'
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
13:42:24 Optimization finished
[1] "finding neighbours for kn 80"
Warning: The following arguments are not used: reduction
Warning: The following arguments are not used: reduction
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 32000
Number of edges: 4000185

Running Louvain algorithm...
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.8744
Number of communities: 13
Elapsed time: 26 seconds
[1] "completed louvain kn  80 resolution  0.6"
[1] 32000
Computing nearest neighbor graph
Computing SNN
13:43:41 UMAP embedding parameters a = 0.9922 b = 1.112
13:43:41 Read 32000 rows and found 10 numeric columns
13:43:41 Using Annoy for neighbor search, n_neighbors = 120
13:43:41 Building Annoy index with metric = cosine, n_trees = 50
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
13:43:45 Writing NN index file to temp file /var/folders/k4/khtkczkd5tn732ftjpwgtr240000gn/T//RtmpcsjJYG/file2f912133e112
13:43:45 Searching Annoy index using 1 thread, search_k = 12000
13:44:34 Annoy recall = 100%
13:44:35 Commencing smooth kNN distance calibration using 1 thread with target n_neighbors = 120
13:44:42 Initializing from normalized Laplacian + noise (using irlba)
13:44:46 Commencing optimization for 200 epochs, with 3950280 positive edges
Using method 'umap'
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
13:45:33 Optimization finished
[1] "finding neighbours for kn 120"
Warning: The following arguments are not used: reduction
Warning: The following arguments are not used: reduction
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 32000
Number of edges: 5858818

Running Louvain algorithm...
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.8655
Number of communities: 13
Elapsed time: 41 seconds
[1] "completed louvain kn  120 resolution  0.6"
[1] 32000
Computing nearest neighbor graph
Computing SNN
13:47:25 UMAP embedding parameters a = 0.9922 b = 1.112
13:47:25 Read 32000 rows and found 10 numeric columns
13:47:25 Using Annoy for neighbor search, n_neighbors = 200
13:47:25 Building Annoy index with metric = cosine, n_trees = 50
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
13:47:29 Writing NN index file to temp file /var/folders/k4/khtkczkd5tn732ftjpwgtr240000gn/T//RtmpcsjJYG/file2f9154fd75c5
13:47:30 Searching Annoy index using 1 thread, search_k = 20000
13:48:48 Annoy recall = 100%
13:48:49 Commencing smooth kNN distance calibration using 1 thread with target n_neighbors = 200
13:49:01 Initializing from normalized Laplacian + noise (using irlba)
13:49:06 Commencing optimization for 200 epochs, with 4802826 positive edges
Using method 'umap'
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
13:49:59 Optimization finished
[1] "finding neighbours for kn 200"
Warning: The following arguments are not used: reduction
Warning: The following arguments are not used: reduction
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 32000
Number of edges: 9488963

Running Louvain algorithm...
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.8514
Number of communities: 10
Elapsed time: 68 seconds
[1] "completed louvain kn  200 resolution  0.6"
[1] 32000
$cluster
NULL

# this function does not add the clustering to the seurat object it is to explore and run stats.  If you choose save = output_path then you will save a seurat object with the clustering, one for each kn.

After checking parameters run cluster function to make add the clustering information into the


seu <- get_clusters(seu, method = "louvain",
                         df_input = df.input,
                         k = 80,
                         resolution = c(1),
                         plots = TRUE,
                         save_plots = FALSE)
Computing nearest neighbor graph
Computing SNN
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 32000
Number of edges: 4000185

Running Louvain algorithm...
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.8450
Number of communities: 18
Elapsed time: 26 seconds
[1] "method is Louvain"
15:38:49 UMAP embedding parameters a = 0.4502 b = 1.076
15:38:49 Read 32000 rows and found 10 numeric columns
15:38:49 Using Annoy for neighbor search, n_neighbors = 80
15:38:49 Building Annoy index with metric = cosine, n_trees = 50
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:38:54 Writing NN index file to temp file /var/folders/k4/khtkczkd5tn732ftjpwgtr240000gn/T//RtmpcsjJYG/file2f9146a08787
15:38:54 Searching Annoy index using 1 thread, search_k = 8000
15:39:30 Annoy recall = 100%
15:39:31 Commencing smooth kNN distance calibration using 1 thread with target n_neighbors = 80
15:39:36 Initializing from normalized Laplacian + noise (using irlba)
15:39:39 Commencing optimization for 200 epochs, with 3116580 positive edges
Using method 'umap'
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:40:21 Optimization finished

# if save_plots is TRUE the feature plots will be save as 13 plots in one file. The UMAP with cluster numbers will also be saved.

Annotate clusters

  1. Visualization for manual annotation. - output by clustering function
  2. CAM (Correlation assignment model) - requires reference matrix
  3. RFM (Random Forest Model) - requires annotated matching flow dataset
  4. Seurat label transfer - requires annotated matching flow data in a seurat object

Visualize expression on UMAP and with heat maps


AB <- c("TH","CD24","CD56","CD29","CD15","CD184","CD133","SSEA4","CD44","CD49f","CD140a")
# the cluster labels will match the active ident
Idents(seu) <- "RNA_snn_res.1"
# this will let us see one at at time
for (i in AB) {
  print(FeaturePlot(seu, features = i, min.cutoff = 'q1', max.cutoff = 'q97', label = TRUE))
}

NA
NA

Visualize your reference matrix

df <- read.csv("/Users/rhalenathomas/GITHUB/CelltypeR/ExampleOuts/ReferenceMatrixPanel2.csv")

# we need to remove the marker column and add these are row names
rownames(df) <- df$X
df <- df %>% select(-"X")
# heatmap function take a matix
mat <- as.matrix(df)

heatmap(mat, 
        Rowv = NA,  # Don't cluster rows
        Colv = NA,  # Don't cluster columns
        col = colorRampPalette(c("white", "blue"))(100),  # Define a color palette
        main = "Reference Matrix")

NA
NA
NA

Some more visualization of expression values

Skip for now

saveRDS(seu, paste(output_path, "Seurat_temp.RDS", sep = ""))

Predict cell annotations with CAM (Correlations assignment method)

df2$X <- df2(rownames)
Error in df2(rownames) : could not find function "df2"

Visualize the CAM results


plot_corr(cor)
Warning in melt(df) :
  The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(df). In the next version, this warning will become an error.
Using X, best.cell.type, second.cell.type, cell.label as id variables
Warning in melt(df.downsample) :
  The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(df.downsample). In the next version, this warning will become an error.
Using X, best.cell.type, second.cell.type, cell.label as id variables
Warning in melt(double.cells) :
  The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(double.cells). In the next version, this warning will become an error.
Using X, best.cell.type, second.cell.type, cell.label as id variables
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]
Warning: Removed 2 rows containing missing values (`geom_line()`).
Warning: Removed 2 rows containing missing values (`geom_point()`).

[[7]]
Warning: Removed 353 rows containing missing values (`geom_line()`).
Warning: Removed 353 rows containing missing values (`geom_point()`).

Apply correlation predictions to clusters and output a vector for annotation functions

Run get annotations function to return a vector of annotation in the order of the clusters.

cor.ann <- get_annotation(seu, seu.cluster = seu$RNA_snn_res.1, 
                          seu.label = seu$cor.labels, top_n = 3, 
                          filter_out = c("Unknown","unknown","Mixed"), 
                          Label = "CAM")
[1] "filtering"
cor.ann
dim(cor.ann)
[1] 18  2
unique(cor.ann$CAM)
[1] NPCDA           Astrocyte       Neuron          RG             
[5] NeuronDA-Neuron RadialGliaDiv   opc             Oligos         
80 Levels: Astrocyte Astrocyte-Endothelial Astrocyte-NPCDA ... unknown
length(cor.ann$CAM)
[1] 18

Use a trained Random Forest model to predict cell types. Training of the Random Forest model with an annotated data set is below.

table(seu$rfm.labels)

          Unknown             Mixed         Neurons 1     Radial Glia 1 
               41             14711              1211                 7 
       Epithelial      Astrocytes 1         Neurons 2      Astrocytes 2 
             2434             10121                 1              2018 
     Astrocytes 3 Astrocytes mature         Neurons 3               NPC 
              456                14               499               480 
    Radial Glia 2     Radial Glia 3       Endothelial  Oligodendrocytes 
                7                 0                 0                 0 
      Stem-like 1       Stem-like 2       Neural stem 
                0                 0                 0 

Get the annotation by cluster for the RFM


rfm.ann <- get_annotation(seu, seu$RNA_snn_res.1,seu$rfm.labels, 
               top_n = 3, filter_out = c("unknown","Unknown","Mixed","Mix"), Label = "RFM")
[1] "filtering"
rfm.ann

#rfm.ann <- get_annotation(seu, seu$RNA_snn_res.0.8,seu$rfm.labels, 
 #              top_n = 3, filter_out = FALSE, Label = "RFM")
rfm.ann
dim(rfm.ann)
[1] 18  2

Plot RFM predictions



plot_lab_clust(seu, seu.cluster = seu$RNA_snn_res.1, seu.labels = seu$rfm.labels, filter_out = c("unknown","Unknown","Mixed"))

NA
NA
# save the predictions so far
saveRDS(seu, paste(output_path, "SeuratSubTimeline.RDS", sep = ""))

Predicting cell types with Seurat label transfer using anchors


proteins <- c("TH","CD24","CD56","CD29","CD15","CD184",
              "CD133","SSEA4","CD44","CD49f","CD140a")
genes <- c("CD24","NCAM1","ITGB1","FUT4",  
                   "CXCR4","PROM1","CD44","PDGFRA","TH",
                   "ST3GAL2","ITGA6")
all <- c(proteins,genes)
# the output is a seurat object with the predicted annotations

seu <- seurat_predict(seu, seu.r, ref_id = 'subgroups', down.sample = 500, markers = all)
Warning: 11 features of the features specified were not present in both the reference query assays. 
Continuing with remaining 11 features.
Projecting cell embeddings
Finding neighborhoods
Finding anchors
    Found 3073 anchors
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Warning: Requested number is larger than the number of available items (13). Setting to 13.
Filtering anchors
    Retained 1155 anchors
Finding integration vectors
Finding integration vector weights
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Predicting cell labels

Get a consensus of cluster annotations, Add the annotations to the seurat object


# make a list of data frames
# all the dataframes need to be as.factor
ann.list <- list(cor.ann,rfm.ann,seu.ann.ft, man.ann)

# annotate the seurat object

seu <- cluster_annotate(seu, ann.list = ann.list, 
                        annotation_name ="CellType", 
                        to_label = "RNA_snn_res.1")

DimPlot(seu, group.by = "CellType")

NA
NA
NA
NA

Just use the annotate functions

Compare groups

We first need to add the variables into the seurat object that we want to compare.

Idents(seu) <- 'Sample'
levels(seu)
 [1] "AIW_150_R1" "AIW_150_R2" "AIW_150_R3" "AIW_150_R4" "AIW_30_R1"  "AIW_30_R2" 
 [7] "AIW_30_R3"  "AIW_30_R4"  "AIW_60_R1"  "AIW_60_R2"  "AIW_60_R3"  "AIW_60_R4" 
[13] "AIW_100_R1" "AIW_100_R2" "AIW_100_R3" "AIW_100_R4"
Age <- c("150","150","150","150",
         "30","30","30","30",
         "60","60","60","60",
         "100","100","100","100")
Replicate <- c("R1","R2","R3","R4",
               "R1","R2","R3","R4",
               "R1","R2","R3","R4",
               "R1","R2","R3","R4")


# vector with the new names - you need this vector from me
cluster.ids <- Age

names(cluster.ids) <- levels(seu)    # get the levels
seu <- RenameIdents(seu, cluster.ids) # rename  
seu$Days_in_FD <- Idents(seu)   # add a new dataslot

Plots some variables to look for differences between groups

proportionplots(seu.q,seu.var = seu$Days_in_FD, seu.lable = seu$CelltypesMain, groups = "Days_in_FD", my_colours = colours)
[1] "Number of colours needed15"
[1] "Number of colours entered 18"
[1] "Custome colours used."

# now check with more distinctive cell types
proportionplots(seu.q,seu.var = seu$Days_in_FD, seu.lable = seu$Celltypes2, groups = "Days_in_FD", my_colours = colours)
[1] "Number of colours needed18"
[1] "Number of colours entered 18"
[1] "Custome colours used."

Make a heat map

# dot plot
var_names <- c("earlyDA-NPC","earlyGlia","Neurons","Astrocytes","stem-like",
"epithelial","earlyRG","DAneurons", "RG", "DA-NPC","earlyNeurons",
"epithelial and precursors","Glia", "NPC","OPC")


# make sure the terms are exactly the same and you don't miss any
new.order <- c("stem-like","epithelial and precursors",
               "earlyDA-NPC","earlyGlia","earlyRG","OPC","NPC","DA-NPC",
               "earlyNeurons","Neurons","DAneurons","epithelial","Astrocytes","Glia","RG"
               )
new.order <- rev(new.order)

AB.order <- c("TH","CD24","CD56","CD29","CD15","CD184",
              "CD133","SSEA4","CD44","CD49f","CD140a")

plotmean(plot_type = 'dotplot',seu = seu, group = 'CelltypesMain', markers = AB, 
                     var_names = var_names, slot = 'scale.data', xlab = "Cell Type",
         ylab = "Antibody", var1order = new.order, var2order = AB.order)

NA
NA

Look at some things across time


table(seu$Celltypes2,seu$Days_in_FD)
                     
                       150   30   60  100
  earlyDA-NPC          365  563 1075  950
  earlyGlia            339 1124  851  403
  Neurons              267  727  995  532
  Astrocytes1          622  512  491  864
  stem-like            566 1168  261  423
  epithelial          1324  105  289  689
  RG-fetal-astro       280 1159  288  528
  Astrocytes2          394  409  560  692
  DAneurons            240  403  773  556
  RG-astro             928  210  292  439
  DANPC                135  542  769  339
  Neurons_early        240  539  502  173
  epithelialprecursor  582  191  326  331
  Glia                 890   10   91  242
  NPC                  161  181  224  613
  OPC                  243   70  111  104
  precursors           130   84  102  122
  stem-like-RG         294    3    0    0

New cell type names based on if cell types are changing the same over time

Save the Seurat object

saveRDS(seu, paste(output_path, "SeuratSubTimeline.RDS", sep = ""))

Train the Random Forest model


# use Revised Celltype
# use all Markers

rf <- RFM_train(seurate_object = seu, 
                             AB_list = AB, 
                annotations = seu$CellTypes,
                      split = c(0.8,0.2),
                      downsample = 1000,
                      seed = 222,
                      mytry = c(1:10),
                      maxnodes = c(12: 25),
                      trees = c(250, 500, 1000,2000),
                      start_node = 15)
[1] "optimize number of features to draw"
[1] "Best number of features to draw is 10"
[1] "Max accuracy is 0.837131944339069"
[1] "Searching for best max node size"
[1] "The max accuracy is 0.85. For the maxnodes of 23"
[1] "searching for best number of trees"
[1] "Best trees  2000"
[1] "The max accuracy is 0.831325301204819. For 2000 trees"
[1] "predict training data"
Confusion Matrix and Statistics

                        Reference
Prediction               earlyDA-NPC earlyGlia Neurons Astrocytes stem-like
  earlyDA-NPC                     79         3       0          3         0
  earlyGlia                        0        49       0          0         0
  Neurons                          0         0      56          0         1
  Astrocytes                       0         0       0        105         0
  stem-like                        0         5       0          0        68
  epithelial                       0         0       1          0         0
  earlyRG                          0         2       0          0         0
  DAneurons                        0         0       0          0         0
  RG-astro                         0         2       0          1         0
  DA-NPC                           2         3       1          0         3
  earlyNeurons                     0         0       0          0         0
  epithelial-endothelial           0         0       0          1         0
  Glia                             0         0       0          0         0
  NPC                              0         0       0          0         0
  OPC                              0         0       0          0         0
  epithelial-maybeOligo            0         0       0          0         0
  glia-maybeOligo                  0         0       0          0         0
                        Reference
Prediction               epithelial earlyRG DAneurons RG-astro DA-NPC earlyNeurons
  earlyDA-NPC                     0       5         0        4      2            0
  earlyGlia                       0       2         0        0      0            0
  Neurons                         1       0         3        0      0            3
  Astrocytes                      0       1         0        0      0            0
  stem-like                       0       3         0        0      0            1
  epithelial                     72       0         0        1      0            2
  earlyRG                         0      61         0        0      0            0
  DAneurons                       0       0         4        0      0            0
  RG-astro                        1       0         0       22      0            0
  DA-NPC                          2       0        38        6     52            0
  earlyNeurons                    1       0         0        0      0           29
  epithelial-endothelial          0       0         0        0      0            0
  Glia                            0       0         0        0      0            0
  NPC                             2       0         0        0      0            0
  OPC                             0       0         0        0      0            0
  epithelial-maybeOligo           0       0         0        0      0            0
  glia-maybeOligo                 0       0         0        0      0            0
                        Reference
Prediction               epithelial-endothelial Glia NPC OPC epithelial-maybeOligo
  earlyDA-NPC                                 3    1   0   0                     0
  earlyGlia                                   2    0   0   0                     0
  Neurons                                     1    0   0   0                     0
  Astrocytes                                  1    1   0   0                     0
  stem-like                                   1    2   0   0                     2
  epithelial                                  3    5   2   7                     0
  earlyRG                                     2    0   0   0                     0
  DAneurons                                   0    0   0   0                     0
  RG-astro                                    0    7   0   5                     0
  DA-NPC                                     15    4   0   1                     0
  earlyNeurons                                2    0   0   1                     1
  epithelial-endothelial                     10    0   0   0                     0
  Glia                                        0    1   0   0                     0
  NPC                                         0    0  25   0                     3
  OPC                                         0    0   0   0                     0
  epithelial-maybeOligo                       0    0   0   0                     0
  glia-maybeOligo                             0    0   0   0                     0
                        Reference
Prediction               glia-maybeOligo
  earlyDA-NPC                          0
  earlyGlia                            0
  Neurons                              0
  Astrocytes                           0
  stem-like                            0
  epithelial                           1
  earlyRG                              0
  DAneurons                            0
  RG-astro                             0
  DA-NPC                               0
  earlyNeurons                         0
  epithelial-endothelial               0
  Glia                                 0
  NPC                                  0
  OPC                                  0
  epithelial-maybeOligo                0
  glia-maybeOligo                      5

Overall Statistics
                                          
               Accuracy : 0.7809          
                 95% CI : (0.7509, 0.8088)
    No Information Rate : 0.1346          
    P-Value [Acc > NIR] : < 2.2e-16       
                                          
                  Kappa : 0.7609          
                                          
 Mcnemar's Test P-Value : NA              

Statistics by Class:

                     Class: earlyDA-NPC Class: earlyGlia Class: Neurons
Sensitivity                     0.97531          0.76562        0.96552
Specificity                     0.97147          0.99469        0.98814
Pos Pred Value                  0.79000          0.92453        0.86154
Neg Pred Value                  0.99721          0.98037        0.99734
Prevalence                      0.09914          0.07834        0.07099
Detection Rate                  0.09670          0.05998        0.06854
Detection Prevalence            0.12240          0.06487        0.07956
Balanced Accuracy               0.97339          0.88016        0.97683
                     Class: Astrocytes Class: stem-like Class: epithelial
Sensitivity                     0.9545          0.94444           0.91139
Specificity                     0.9958          0.98121           0.97019
Pos Pred Value                  0.9722          0.82927           0.76596
Neg Pred Value                  0.9929          0.99456           0.99032
Prevalence                      0.1346          0.08813           0.09670
Detection Rate                  0.1285          0.08323           0.08813
Detection Prevalence            0.1322          0.10037           0.11506
Balanced Accuracy               0.9752          0.96283           0.94079
                     Class: earlyRG Class: DAneurons Class: RG-astro Class: DA-NPC
Sensitivity                 0.84722         0.088889         0.66667       0.96296
Specificity                 0.99463         1.000000         0.97959       0.90170
Pos Pred Value              0.93846         1.000000         0.57895       0.40945
Neg Pred Value              0.98537         0.949569         0.98588       0.99710
Prevalence                  0.08813         0.055080         0.04039       0.06610
Detection Rate              0.07466         0.004896         0.02693       0.06365
Detection Prevalence        0.07956         0.004896         0.04651       0.15545
Balanced Accuracy           0.92093         0.544444         0.82313       0.93233
                     Class: earlyNeurons Class: epithelial-endothelial Class: Glia
Sensitivity                      0.82857                       0.25000    0.047619
Specificity                      0.99361                       0.99871    1.000000
Pos Pred Value                   0.85294                       0.90909    1.000000
Neg Pred Value                   0.99234                       0.96278    0.975490
Prevalence                       0.04284                       0.04896    0.025704
Detection Rate                   0.03550                       0.01224    0.001224
Detection Prevalence             0.04162                       0.01346    0.001224
Balanced Accuracy                0.91109                       0.62436    0.523810
                     Class: NPC Class: OPC Class: epithelial-maybeOligo
Sensitivity             0.92593    0.00000                     0.000000
Specificity             0.99367    1.00000                     1.000000
Pos Pred Value          0.83333        NaN                          NaN
Neg Pred Value          0.99746    0.98286                     0.992656
Prevalence              0.03305    0.01714                     0.007344
Detection Rate          0.03060    0.00000                     0.000000
Detection Prevalence    0.03672    0.00000                     0.000000
Balanced Accuracy       0.95980    0.50000                     0.500000
                     Class: glia-maybeOligo
Sensitivity                        0.833333
Specificity                        1.000000
Pos Pred Value                     1.000000
Neg Pred Value                     0.998768
Prevalence                         0.007344
Detection Rate                     0.006120
Detection Prevalence               0.006120
Balanced Accuracy                  0.916667
[1] "predict test data"
Confusion Matrix and Statistics

                        Reference
Prediction               earlyDA-NPC earlyGlia Neurons Astrocytes stem-like
  earlyDA-NPC                     23         0       0          0         1
  earlyGlia                        0        17       0          0         0
  Neurons                          0         0      12          0         0
  Astrocytes                       0         0       0         29         0
  stem-like                        0         1       0          0        10
  epithelial                       0         0       0          0         1
  earlyRG                          0         0       0          0         0
  DAneurons                        0         0       0          0         0
  RG-astro                         0         1       0          0         0
  DA-NPC                           1         0       0          0         0
  earlyNeurons                     0         0       0          0         0
  epithelial-endothelial           0         0       0          0         0
  Glia                             0         0       0          0         0
  NPC                              0         0       0          0         0
  OPC                              0         0       0          0         0
  epithelial-maybeOligo            0         0       0          0         0
  glia-maybeOligo                  0         0       0          0         0
                        Reference
Prediction               epithelial earlyRG DAneurons RG-astro DA-NPC earlyNeurons
  earlyDA-NPC                     0       1         1        1      0            0
  earlyGlia                       0       0         0        0      0            0
  Neurons                         1       0         0        0      0            1
  Astrocytes                      0       0         0        1      0            0
  stem-like                       0       1         0        2      0            1
  epithelial                     16       0         0        0      0            1
  earlyRG                         0       6         0        0      0            0
  DAneurons                       0       0         0        0      0            0
  RG-astro                        1       0         0        3      0            0
  DA-NPC                          0       0         9        5     11            0
  earlyNeurons                    0       0         0        0      0            5
  epithelial-endothelial          0       0         0        0      0            0
  Glia                            0       0         0        0      0            0
  NPC                             1       0         0        0      0            0
  OPC                             0       0         0        0      0            0
  epithelial-maybeOligo           0       0         0        0      0            0
  glia-maybeOligo                 1       0         0        0      0            0
                        Reference
Prediction               epithelial-endothelial Glia NPC OPC epithelial-maybeOligo
  earlyDA-NPC                                 1    0   0   0                     0
  earlyGlia                                   0    0   0   0                     0
  Neurons                                     0    0   0   0                     0
  Astrocytes                                  0    0   0   0                     0
  stem-like                                   0    0   0   1                     1
  epithelial                                  1    0   0   3                     0
  earlyRG                                     0    0   0   0                     0
  DAneurons                                   0    0   0   0                     0
  RG-astro                                    0    1   0   0                     0
  DA-NPC                                      1    1   0   0                     0
  earlyNeurons                                0    0   1   0                     0
  epithelial-endothelial                      2    0   0   0                     0
  Glia                                        0    0   0   0                     0
  NPC                                         0    0   4   0                     0
  OPC                                         0    0   0   0                     0
  epithelial-maybeOligo                       0    0   0   0                     0
  glia-maybeOligo                             0    0   0   0                     0
                        Reference
Prediction               glia-maybeOligo
  earlyDA-NPC                          0
  earlyGlia                            0
  Neurons                              0
  Astrocytes                           0
  stem-like                            0
  epithelial                           0
  earlyRG                              0
  DAneurons                            0
  RG-astro                             0
  DA-NPC                               0
  earlyNeurons                         0
  epithelial-endothelial               0
  Glia                                 0
  NPC                                  0
  OPC                                  0
  epithelial-maybeOligo                0
  glia-maybeOligo                      1

Overall Statistics
                                         
               Accuracy : 0.7596         
                 95% CI : (0.691, 0.8195)
    No Information Rate : 0.1585         
    P-Value [Acc > NIR] : < 2.2e-16      
                                         
                  Kappa : 0.7342         
                                         
 Mcnemar's Test P-Value : NA             

Statistics by Class:

                     Class: earlyDA-NPC Class: earlyGlia Class: Neurons
Sensitivity                      0.9583           0.8947        1.00000
Specificity                      0.9686           1.0000        0.98830
Pos Pred Value                   0.8214           1.0000        0.85714
Neg Pred Value                   0.9935           0.9880        1.00000
Prevalence                       0.1311           0.1038        0.06557
Detection Rate                   0.1257           0.0929        0.06557
Detection Prevalence             0.1530           0.0929        0.07650
Balanced Accuracy                0.9634           0.9474        0.99415
                     Class: Astrocytes Class: stem-like Class: epithelial
Sensitivity                     1.0000          0.83333           0.80000
Specificity                     0.9935          0.95906           0.96319
Pos Pred Value                  0.9667          0.58824           0.72727
Neg Pred Value                  1.0000          0.98795           0.97516
Prevalence                      0.1585          0.06557           0.10929
Detection Rate                  0.1585          0.05464           0.08743
Detection Prevalence            0.1639          0.09290           0.12022
Balanced Accuracy               0.9968          0.89620           0.88160
                     Class: earlyRG Class: DAneurons Class: RG-astro Class: DA-NPC
Sensitivity                 0.75000          0.00000         0.25000       1.00000
Specificity                 1.00000          1.00000         0.98246       0.90116
Pos Pred Value              1.00000              NaN         0.50000       0.39286
Neg Pred Value              0.98870          0.94536         0.94915       1.00000
Prevalence                  0.04372          0.05464         0.06557       0.06011
Detection Rate              0.03279          0.00000         0.01639       0.06011
Detection Prevalence        0.03279          0.00000         0.03279       0.15301
Balanced Accuracy           0.87500          0.50000         0.61623       0.95058
                     Class: earlyNeurons Class: epithelial-endothelial Class: Glia
Sensitivity                      0.62500                       0.40000     0.00000
Specificity                      0.99429                       1.00000     1.00000
Pos Pred Value                   0.83333                       1.00000         NaN
Neg Pred Value                   0.98305                       0.98343     0.98907
Prevalence                       0.04372                       0.02732     0.01093
Detection Rate                   0.02732                       0.01093     0.00000
Detection Prevalence             0.03279                       0.01093     0.00000
Balanced Accuracy                0.80964                       0.70000     0.50000
                     Class: NPC Class: OPC Class: epithelial-maybeOligo
Sensitivity             0.80000    0.00000                     0.000000
Specificity             0.99438    1.00000                     1.000000
Pos Pred Value          0.80000        NaN                          NaN
Neg Pred Value          0.99438    0.97814                     0.994536
Prevalence              0.02732    0.02186                     0.005464
Detection Rate          0.02186    0.00000                     0.000000
Detection Prevalence    0.02732    0.00000                     0.000000
Balanced Accuracy       0.89719    0.50000                     0.500000
                     Class: glia-maybeOligo
Sensitivity                        1.000000
Specificity                        0.994505
Pos Pred Value                     0.500000
Neg Pred Value                     1.000000
Prevalence                         0.005464
Detection Rate                     0.005464
Detection Prevalence               0.010929
Balanced Accuracy                  0.997253
saveRDS(rf, paste(output_path,"trainedRFMfromTimeCourseSub.Rds",sep =""))

Now I will use the full dataset The cell types will be more clear with the full data set.

Statistics comparing groups


# prepare a dataframe for stats
# this function takes the annotated seurat object with all the variables already existing as metadata slots

# check what meta data slots exist in your object
colnames(seu@meta.data)
 [1] "orig.ident"      "nCount_RNA"      "nFeature_RNA"    "Sample"         
 [5] "RNA_snn_res.0.5" "RNA_snn_res.8.1" "seurat_clusters" "RNA_snn_res.0.9"
 [9] "RNA_snn_res.1"   "cor.labels"      "rfm.labels"      "seu.pred"       
[13] "CellType"        "Celltypes2"      "CelltypesMain"   "Replicate"      
[17] "Days_in_FD"     
# run the function

var.names <- c("Days_in_FD","Sample","Replicate","CelltypesMain")

df.for.stats <- Prep_for_stats(seu, marker_list = AB, variables = var.names, 
                               marker_name = 'Marker')


# save the csv for later
# write.csv(df.for.stats, paste(output_path,"filename.csv"))

head(df.for.stats)
NA
NA

First we have 3 variables: Experimental variable (Days in culture), Cell types, Markers We want to compare the mean expression per group: For all antibodies together in each cell type between a given variable (Genotype) (One way anova) We want to compare each antibody separately for a given variable for each cell type (two way anova)



# one way anova (combine all antibodies)
# two way anova variable 1 = antibody/marker variable 2 = group variable

# normally runs a loop across each cell type
# option to select to calculate for all cell types together

# can run the loop across antibodies

# group variables we can run: Genotype, Batch, days in culture, Experiment date

# we run one-way here with different conditions

# compare genotypes for each cell type
test.stats1 <- run_stats(input_df= df.for.stats, group_cols = c("Sample", "CelltypesMain","Marker","Days_in_FD","Replicate"),
                     value_col = "value",
                     stat_type = "ANOVA", id1 = 'Days_in_FD', 
                     id2 = NULL, use_means = TRUE,
                     loop_by = "CelltypesMain")
[1] "ANOVA results for all celltypes and markers combined"
[1] "TukeyHSD results for all celltypes and markers combined"
# see the dataframe results
test.stats1[['ANOVA']]
test.stats1[['TukeyHSD']]
NA
NA
NA

Overall effect we can see a significant effect of Days in culture on cell types In pair wise conparisons only 30 vs 100 days is dfferent.

# Compare expression across cell types for each marker
test.stats2 <- run_stats(input_df= df.for.stats, group_cols = c("Sample", "CelltypesMain","Marker","Days_in_FD"),
                     value_col = "value",
                     stat_type = "ANOVA", id1 = 'Days_in_FD', 
                     id2 = NULL, use_means = TRUE,
                     loop_by = "Marker")
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'filter' in selecting a method for function 'filter': object 'Marker' not found
# compare genotype for each cell type without taking the group means and using each cell as an n (not good practice)
test.stats4 <- run_stats(input_df= df.for.stats, group_cols = c("Sample", "CellType","Marker","Genotype","Batch"),
                     value_col = "value",
                     stat_type = "ANOVA", id1 = 'Genotype', 
                     id2 = NULL, use_means = FALSE,
                     loop_by = "CellType")

test.stats4[[1]] # ANOVA

Test two way ANOVAs

test.stats5 <- run_stats(input_df= df.for.stats, group_cols = c("Sample", "CelltypesMain","Days_in_FD","Marker"),
                     value_col = "value",
                     stat_type = "ANOVA2", id1 = 'Days_in_FD', 
                     id2 = "Marker", use_means = TRUE,
                     loop_by = "CellType")
Warning: Unknown or uninitialised column: `CellType`.
Error in `colnames<-`(`*tmp*`, value = c("Celltype", "Contrast", "Df",  : 
  attempt to set 'colnames' on an object with less than two dimensions
test.stats6 <- run_stats(input_df= df.for.stats, group_cols = c("Sample", "CellType","Marker","Genotype","Batch"),
                     value_col = "value",
                     stat_type = "ANOVA2", id1 = 'Genotype', 
                     id2 = "CellType", use_means = TRUE,
                     loop_by = "Marker")


# see the interactions Tukey's results where id1 or id2 match

df <- as.data.frame(test.stats6[["TukeyHSD"]][["Interactions_ Genotype"]])
head(df)

# now filter for significant differences

df_sig <- df %>% filter(p.adj < 0.05)
df_sig

df <- as.data.frame(test.stats6[["TukeyHSD"]][["Interactions_ CellType"]])
head(df)
# now filter for significant differences
df_sig <- df %>% filter(p.adj < 0.05)
df_sig

Train Random Forest model Requires a labelled seurat object More cells will give higher accuracy but increase computation time. Run in HPC with lots of cells

save(rf, paste(output_path,"trainedRFMfrom9MOsubsetOverlapPanel.Rds",sep = ""))
Error in save(rf, paste(output_path, "trainedRFMfrom9MOsubsetOverlapPanel.Rds",  : 
  object ‘paste(output_path, "trainedRFMfrom9MOsubsetOverlapPanel.Rds", sep = "")’ not found
NA
LS0tCnRpdGxlOiAiQ2VsbHR5cGVSIHdvcmtmbG93IgpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sKLS0tCgoxLiBEYXRhIHByZXByb2Nlc3Npbmc6IHB1dCBhbGwgdGltZXBvaW50cyBhbmQgcmVwbGljYXRlcyBpbnRvIG9uZSBmb2xkZXIKYS4gUmVhZCBGbG93Sm8gZmlsZXMgaW50byBSLgpiLiBDcmVhdGUgYSBkYXRhIGZyYW1lIHdpdGggaW50ZW5zaXR5IG1lYXN1cmVtZW50cyBmb3IgZWFjaCBtYXJrZXIgZm9yIGFsbCAgICAgICAgICBzYW1wbGVzIHdpdGhpbiB0aGUgZXhwZXJpbWVudCB0byBiZSBhbmFseXplZC4gIAotIGRvd25zYW1wbGUgdGFraW5nIGEgMjAwMCBjZWxscyBmcm9tIGVhY2ggc2FtcGxlIHRvIHNwZWVkIHVwIGNvbXB1dGF0aW9uLgpjLiBIYXJtb25pemUgZGF0YSAKZC4gQ3JlYXRlIGRhdGFmcmFtZQplLiBDcmVhdGUgYSBTZXVyYXQgb2JqZWN0CgoyLiBDbHVzdGVyIGRhdGEKMy4gQW5ub3RhdGUgY2x1c3RlcnMgd2l0aCBjZWxsIHR5cGVzLgphLiBQcmVkaWN0IGNlbGwgdHlwZXMgYnkgY29ycmVsYXRpb24gbWF0cml4CmIuIFZpc3VhbGl6ZSBleHByZXNzaW9uIGJ5IGNsdXN0ZXIgZm9yIG1hbnVhbCBhbm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